# Maintainer: Maxime Gauduin <alucryd@archlinux.org>
# Contributor: Ionut Biru <ibiru@archlinux.org>
# Contributor: Bartłomiej Piotrowski <bpiotrowski@archlinux.org>
# Contributor: Andrew Cook <ariscop@gmail.com>

pkgname=libbluray
pkgver=1.3.0
pkgrel=1
pkgdesc='Library to access Blu-Ray disks for video playback'
arch=(x86_64)
url=https://www.videolan.org/developers/libbluray.html
license=(LGPL2.1)
depends=(
  fontconfig
  libfreetype.so
  libxml2
)
makedepends=(
  apache-ant
  git
  java-environment
)
optdepends=('java-runtime: BD-J library')
provides=(libbluray.so)
_tag=311f09286e94565e1acb2e98bb7afaa903d6be13
source=(
  git+https://code.videolan.org/videolan/libbluray.git#tag=${_tag}
  git+https://code.videolan.org/videolan/libudfread.git
)
b2sums=(
  SKIP
  SKIP
)

pkgver() {
  cd libbluray

  git describe --tags
}

prepare() {
  cd libbluray

  for submodule in contrib/libudfread; do
    git submodule init ${submodule}
    git config submodule.${submodule}.url ../${submodule#*/}
    git submodule update ${submodule}
  done

  autoreconf -fiv
}

build() {
  cd libbluray

  ./configure \
    --prefix=/usr
  make
}

package() {
  make DESTDIR="${pkgdir}" -C libbluray install
}

# vim: ts=2 sw=2 et:
